# $Id: PKGBUILD 86431 2013-03-16 21:53:06Z arodseth $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Det <nimetonmaili at gmail a-dot com>
# Contributor: Godane aka Christopher Rogers <slaxemulator@gmail.com>
# Contributor: Michai Coman <mihai@m1x.ro>

pkgname=unetbootin
pkgver=583
pkgrel=5
arch=('x86_64' 'i686')
license=('GPL')
pkgdesc='Create bootable Live USB drives'
url='http://unetbootin.sourceforge.net/'
depends=('syslinux' 'p7zip' 'qt4' 'mtools' 'polkit' 'guisu')
optdepends=('polkit-gnome: to run unetbootin directly from menu')
install=$pkgname.install
source=("http://downloads.sourceforge.net/project/$pkgname/UNetbootin/$pkgver/$pkgname-source-$pkgver.tar.gz"
        'org.archlinux.pkexec.unetbootin.policy')
sha256sums=('0fba985a6d4a7a4c388cb99d100cb46fbd9bbae831501ad887a8d5f148a24029'
            '4de02f754f86707c92d20b1c7cfda323893d3d4ed54047b06c036588e677a87c')

build() {
  cd "$srcdir"

  lupdate "$pkgname.pro"
  lrelease "$pkgname.pro"
  qmake
  make
}

package() {
  cd "$srcdir"

  install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname.elf"
  ln -s /usr/bin/guisu "$pkgdir/usr/bin/$pkgname"

  mkdir -p "$pkgdir/usr/share/$pkgname"
  install -m644 "$pkgname"_*.qm "$pkgdir/usr/share/$pkgname/"
  install -Dm644 "$pkgname.desktop" \
    "$pkgdir/usr/share/applications/$pkgname.desktop"
  for i in 16 22 24 32 48 256; do
    install -D "${pkgname}_${i}.png" \
      "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
  done
  install -Dm644 'org.archlinux.pkexec.unetbootin.policy' \
    "$pkgdir/usr/share/polkit-1/actions/org.archlinux.pkexec.unetbootin.policy"
}

# vim:set ts=2 sw=2 et:
